Skip to main content

All Questions

0votes
1answer
2kviews

Parsing messages with fixed-width fields into Employee objects

I'm writing a application that reads from a queue of messages from a legacy mainframe system. Some characteristics of message in the queue: Message from the Q is always fixed length plain text : 64 ...
edwin's user avatar
2votes
4answers
900views

Split a string into a list of tokens

I have the following assignment that I succeeded in solving, but the code is very inefficient. I would appreciate if someone could show me a more efficient way, perhaps with substring. Note that I am ...
Yuki1112's user avatar
3votes
2answers
383views

Extract SSID and BSSID from a file

I have file called Network.txt which contains SSID and BSSID as below: ...
leuage's user avatar
2votes
1answer
63views

Extract integers from a string that is split at given positions

I am writing a program which runs quite slow and on profiling I found that the bottleneck is to split a given string at given positions. The first and short version I wrote was (80% of 67 sec, i.e. ...
RE60K's user avatar
  • 1,466
2votes
1answer
967views

Split string into "n" lengths with padding

I quickly wrote a short program to split a string into \$n\$ lengths with variable-character padding: ...
esote's user avatar
  • 3,800
2votes
1answer
641views

Flexible String tokenization in Swift

I want a flexible and fast way to break a string up into strongly typed tokens so that I can do things like the following: ...
MathewS's user avatar
2votes
1answer
3kviews

Parsing in between of brackets

I do parsing of the string in order to find wrapped sub-string inside brackets of the first level. a+(b+(d-g))+g+d, in this case I will need to separate ...
Cron Merdek's user avatar
4votes
5answers
259views

Consecutive whitespace reduction

I pursued an according algorithm with an absolute best performance, the following class embodies the solution. Any comment is welcome. ...
Avenicci's user avatar
7votes
2answers
10kviews

Removing curly braces and contents inside it

Lets say I have a string like this: string s = "A }{ B { C } }{" //Indexes: 0123456789ABCDE Just consider the indexes beyond #9 are 10,11,12,13, and 14 ...
wingerse's user avatar
1vote
2answers
70views

Function that check's file type based on certain keywords

I have a function that breaks up a source file and checks each token against a keyword list to determine whether its a particular file type. How can I improve this function? ...
lostForAWHile's user avatar
4votes
3answers
446views

Parsing huge data coming from a URL

I need to parse the data coming from the URL which looks like this: ...
david's user avatar
  • 1,997
4votes
5answers
940views

Optimising single-delimiter string tokenisation

I am trying to optimise my tokenizing of tab delimited strings: ...
PidgeyBAWK's user avatar
6votes
0answers
873views

Parsing Lua 5.2 strings with patterns

I wrote some code to parse Lua 5.2 strings in Lua 5.1, using patterns. It works perfectly as far as I tested. ...
SoniEx2's user avatar
10votes
2answers
130views

Scalability of running commands from user input

Here is some code I have that has been extracted and shrunk down from a project of mine. ...
syb0rg's user avatar
  • 21.9k

close